import request from '../utils/request';

export const sysUserPage = query => {
    return request({
        url: '/sysUser/page',
        method: 'get',
        params: query
    });
};

export const sysUserList = query => {
    return request({
        url: '/sysUser/list',
        method: 'get',
        params: query
    });
};

export const sysUserInfo = () => {
    return request({
        url: '/sysUser/info',
        method: 'get'
    });
};

export const systemInfo = () => {
    return request({
        url: '/sysUser/systemInfo',
        method: 'get'
    });
};

export const sysUserRoleList = query => {
    return request({
        url: '/sysRole/list',
        method: 'get',
        params: query
    });
};

export const sysUserCheckUnique = query => {
    return request({
        url: '/sysUser/checkUnique',
        method: 'get',
        params: query
    });
};

export const sysUserCheckPassword = query => {
    return request({
        url: '/sysUser/checkPassword',
        method: 'get',
        params: query
    });
};

export const saveSysUser = data => {
    return request({
        url: '/sysUser/save',
        method: 'post',
        data: data
    });
};

export const updateSysUser = data => {
    return request({
        url: '/sysUser/update',
        method: 'put',
        data: data
    });
};

export const updateSysUserBasic = data => {
    return request({
        url: '/sysUser/updateBasic',
        method: 'put',
        data: data
    });
};

export const updateSysUserPassword = data => {
    return request({
        url: '/sysUser/updatePassword',
        method: 'put',
        data: data
    });
};

export const delSysUser = data => {
    return request({
        url : '/sysUser/delete/' + data,
        method: 'delete'
    });
};